package com.IR.user.service;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.IR.shop.mapper.SiteMapper;
import com.IR.shop.po.Site;
import com.IR.shop.po.SiteExample;

@Service
public class BSiteBIZ {
	
	@Resource
	private SiteMapper sitemapper;
	
	/*查询地址*/
	public List<Site> showUserSite(Long userid){
		SiteExample sexample=new SiteExample();
		SiteExample.Criteria c=sexample.createCriteria();
		c.andUseridEqualTo(userid);
		return sitemapper.selectByExample(sexample);
	}
   /* 查看默认地址*/
	public Site showSite(Long userid){
		SiteExample sexample=new SiteExample();
		SiteExample.Criteria c=sexample.createCriteria();
		c.andUseridEqualTo(userid);
		c.andScodeEqualTo("默认");
		List<Site> list=null;
		list=sitemapper.selectByExample(sexample);
		Site site=list.get(0);
		return site;
	}
}
